import request from '@/utils/request'

/**
 * 查询所有可下达工单
 * @param data
 */
export function queryAllRelease(data) {
  return request({
    url: `/md/shopOrders/queryShopOrderRelease`,
    method: 'post',
    data
  })
}

/**
 * 变更工艺路线
 * @param data.bo
 * @param data.router
 * @param data.version
 */
export function alterationRouter(data) {
  return request({
    url: `/md/shopOrders/updateShopOrderRouter?bo=${data.bo}&router=${data.router}&version=${data.version}`,
    method: 'get'
  })
}

/**
 * 批量下达
 * @param data
 */
export function release(data) {
  return request({
    url: `/md/shopOrders/orderReleaseBatch`,
    method: 'post',
    data
  })
}
/**
 * 查询可撤回的下达工单
 * @param data
 */
export function recallOperationOrder(data) {
  return request({
    url: `/md/shopOrders/getCanCancelOperationOrder`,
    method: 'post',
    data
  })
}
/**
 * 查询可撤回的下达工单
 * @param data => operationOrderList ['']
 */
export function confirmRecall(data) {
  return request({
    url: `/md/shopOrders/okCancelOperationOrder`,
    method: 'post',
    data
  })
}
